/* 简洁古风 Markdown 主题 - 白色版 */

.markdown-body {
  --base-size-4: 0.25rem;
  --base-size-8: 0.5rem;
  --base-size-16: 1rem;
  --base-size-24: 1.5rem;
  --base-size-40: 2.5rem;
  --base-text-weight-normal: 400;
  --base-text-weight-medium: 500;
  --base-text-weight-semibold: 600;
  --fontStack-monospace: '仿宋', 'FangSong', 'Courier New', monospace;
}

.markdown-body,
[data-theme='light'] {
  color-scheme: light;

  /* 纯白简洁配色 */
  --bgColor-default: #ffffff;
  --bgColor-muted: #f8f8f8;
  --bgColor-neutral-muted: #f0f0f088;

  /* 灰黑色系文字 */
  --fgColor-default: #2c2c2c;
  --fgColor-muted: #666666;
  --fgColor-accent: #d0504f;

  /* 边框色 */
  --borderColor-default: #e0e0e0;
  --borderColor-muted: #eeeeee;
  --borderColor-accent: #d0504f;

  --focus-outlineColor: #d0504f;
}

@media (prefers-color-scheme: dark) {
  .markdown-body,
  [data-theme='dark'] {
    color-scheme: dark;
    --bgColor-default: rgb(26, 26, 26, 0.6);
    --bgColor-muted: #262626;
    --bgColor-neutral-muted: #33333388;
    --fgColor-default: #e8e8e8;
    --fgColor-muted: #a0a0a0;
    --fgColor-accent: #e85d5d;
    --borderColor-default: #404040;
    --borderColor-muted: #333333;
    --borderColor-accent: #e85d5d;
    --focus-outlineColor: #e85d5d;
  }
}

.markdown-body {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  margin: 10px 16px;
  color: var(--fgColor-default);
  font-size: 16px;
  line-height: 1.8;
  word-wrap: break-word;
  padding: 16px;
  background: var(--bgColor-default);
  border: 1px solid var(--borderColor-default);
  border-radius: 4px;
}

/* 标题样式 */
.markdown-body h1 {
  margin: 1.5em 0 0.8em;
  padding-bottom: 0.3em;
  font-size: 2em;
  font-weight: 600;
  border-bottom: 2px solid var(--borderColor-default);
  letter-spacing: 0.05em;
}

.markdown-body h2 {
  margin: 0 0 0.6em;
  padding-bottom: 0.3em;
  font-size: 1.5em;
  font-weight: 600;
  border-bottom: 1px solid var(--borderColor-default);
  letter-spacing: 0.03em;
}

.markdown-body h3 {
  margin: 1.2em 0 0.5em;
  font-size: 1.25em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.markdown-body h4 {
  margin: 1em 0 0.5em;
  font-size: 1.1em;
  font-weight: 600;
}

.markdown-body h5,
.markdown-body h6 {
  margin: 1em 0 0.5em;
  font-size: 1em;
  font-weight: 600;
  color: var(--fgColor-muted);
}

/* 段落 */
.markdown-body p {
  margin: 0 0 1em;
  text-align: justify;
  line-height: 1.8;
}

/* 链接 */
.markdown-body a {
  color: var(--fgColor-accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.markdown-body a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* 引用块 */
.markdown-body blockquote {
  margin: 1em 0;
  padding: 0.8em 1.2em;
  color: var(--fgColor-muted);
  border-left: 3px solid var(--fgColor-accent);
  background: var(--bgColor-muted);
}

.markdown-body blockquote p {
  margin: 0;
}

/* 列表 */
.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1em;
  padding-left: 2em;
}

.markdown-body li {
  margin: 0.3em 0;
}

/* 代码 */
.markdown-body code,
.markdown-body tt {
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 90%;
  background-color: var(--bgColor-muted);
  border: 1px solid var(--borderColor-muted);
  border-radius: 3px;
}

.markdown-body pre {
  margin: 1em 0;
  padding: 1em;
  overflow: auto;
  font-size: 90%;
  line-height: 1.6;
  background-color: var(--bgColor-muted);
  border: 1px solid var(--borderColor-default);
  border-radius: 4px;
}

.markdown-body pre code {
  padding: 0;
  margin: 0;
  font-size: 100%;
  background: transparent;
  border: none;
}

/* 表格 */
.markdown-body table {
  margin: 1em 0;
  border-spacing: 0;
  border-collapse: collapse;
  display: block;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--borderColor-default);
}

.markdown-body table th {
  font-weight: 600;
  background: var(--bgColor-muted);
  padding: 10px 15px;
  border: 1px solid var(--borderColor-default);
}

.markdown-body table td {
  padding: 8px 15px;
  border: 1px solid var(--borderColor-default);
}

.markdown-body table tr:nth-child(2n) {
  background-color: var(--bgColor-muted);
}

/* 分割线 */
.markdown-body hr {
  height: 0;
  margin: 2em 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--borderColor-default);
}

/* 强调 */
.markdown-body strong {
  font-weight: 600;
  color: var(--fgColor-default);
}

.markdown-body em {
  font-style: italic;
}

/* 图片 */
.markdown-body img {
  max-width: 100%;
  border: 1px solid var(--borderColor-muted);
  border-radius: 2px;
}

/* kbd */
.markdown-body kbd {
  display: inline-block;
  padding: 0.2em 0.5em;
  font-size: 90%;
  color: var(--fgColor-default);
  background-color: var(--bgColor-muted);
  border: 1px solid var(--borderColor-default);
  border-radius: 3px;
}

/* 任务列表 */
.markdown-body .task-list-item {
  list-style-type: none;
}

.markdown-body .task-list-item-checkbox {
  margin: 0 0.5em 0.25em -1.6em;
  vertical-align: middle;
  accent-color: var(--fgColor-accent);
}

/* 警告框 */
.markdown-body .markdown-alert {
  padding: 1em;
  margin: 1em 0;
  border-left: 3px solid var(--borderColor-default);
  background: var(--bgColor-muted);
}

.markdown-body .markdown-alert-title {
  font-weight: 600;
  margin-bottom: 0.5em;
}

.markdown-body .markdown-alert.markdown-alert-note {
  border-left-color: #4493f8;
}

.markdown-body .markdown-alert.markdown-alert-warning {
  border-left-color: #d4a944;
}

.markdown-body .markdown-alert.markdown-alert-tip {
  border-left-color: #3fb950;
}

.markdown-body .markdown-alert.markdown-alert-caution {
  border-left-color: var(--fgColor-accent);
}

/* 脚注 */
.markdown-body .footnotes {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid var(--borderColor-default);
  font-size: 90%;
  color: var(--fgColor-muted);
}

/* 选中文本 */
.markdown-body ::selection {
  background: var(--fgColor-accent);
  color: #ffffff;
}

/* 滚动条 */
.markdown-body ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.markdown-body ::-webkit-scrollbar-track {
  background: var(--bgColor-muted);
}

.markdown-body ::-webkit-scrollbar-thumb {
  background: var(--borderColor-default);
  border-radius: 4px;
}

.markdown-body ::-webkit-scrollbar-thumb:hover {
  background: var(--fgColor-muted);
}

/* 基础元素重置 */
.markdown-body .octicon {
  display: inline-block;
  fill: currentColor;
  vertical-align: text-bottom;
}

.markdown-body details,
.markdown-body figcaption,
.markdown-body figure {
  display: block;
}

.markdown-body summary {
  display: list-item;
  cursor: pointer;
}

.markdown-body [hidden] {
  display: none !important;
}

.markdown-body abbr[title] {
  border-bottom: none;
  text-decoration: underline dotted;
}

.markdown-body b,
.markdown-body strong {
  font-weight: 600;
}

.markdown-body dfn {
  font-style: italic;
}

.markdown-body mark {
  background-color: #fff8c5;
  color: var(--fgColor-default);
}

.markdown-body small {
  font-size: 90%;
}

.markdown-body sub,
.markdown-body sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.markdown-body sub {
  bottom: -0.25em;
}

.markdown-body sup {
  top: -0.5em;
}

.markdown-body input {
  font: inherit;
  margin: 0;
}

.markdown-body ::placeholder {
  color: var(--fgColor-muted);
  opacity: 1;
}

.markdown-body dd {
  margin-left: 0;
}

.markdown-body dl {
  padding: 0;
}

.markdown-body dl dt {
  padding: 0;
  margin-top: 1em;
  font-size: 1em;
  font-style: italic;
  font-weight: 600;
}

.markdown-body dl dd {
  padding: 0 1em;
  margin-bottom: 1em;
}

.markdown-body > *:first-child {
  margin-top: 0 !important;
}

.markdown-body > *:last-child {
  margin-bottom: 0 !important;
}
